<?php

namespace app\finance\controller;

use app\finance\model\Order;
use think\admin\Controller;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;

class TradeLog extends Controller
{
    /**
     * @return void
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     */
    public function index(){
        $this->title = '交易日志';

        $query = $this->_query(Order::class);
        if (isset($uid)) {
            $query->where(['uid' => $uid]);
        }

        $query->alias('o')
            ->equal("type,status")
            ->like('order_no')
            ->with("User")
            ->order('id', 'DESC')
            ->page(true, true);
    }
}